<% row_class = cycle('even', 'odd') %>
  <tr class="<%= row_class %>">
    <td><%= administrator.user_info.email %></td>
    <td><%= administrator.user_info.name %></td>
    <td><%= administrator.user_info.surname %></td>
    <td><%= raw(l administrator.user_info.last_login_at, :format => :long) rescue raw(l administrator.current_login_at, :format => :long) rescue 'Ještě se nepřihlásil' %></td>
    <td>
      <% unless administrator.roles.blank? %>
        <%= administrator.roles.map(&:role).to_sentence %>
      <% else %>
        Žádná
      <% end %>
    </td>
    <td>
      <% unless administrator.roles.blank? %>
        <%= administrator.roles.map(&:permissions).to_sentence %>
      <% else %>
        Žádná
      <% end %>
    </td>
    <td>
        <% if (permitted_to? :edit, administrator) || (has_role?(:administrator)) %>
           <%# link_to_remote 'Editovat&nbsp;&raquo;', {
                   :url => edit_administrator_administratoristrator_path(administrator),
                   :method => :get,
                   :loading => "jQuery('#searching').show();",
                   :complete => "jQuery('#searching').hide();",
                   :update => "new_administratoristrator"} %>
        <% end %>
      <% if (permitted_to? :delete, administrator) && current_user != administrator %>
        [<%= link_to "X", administrator_administratoristrator_path(administrator), :confirm => "Opravdu chcete smazat tohoto uživatele?", :method => :delete, :remote => true, :title => "Smazat uživatele" %>]
      <% end %>
      
    </td>
  </tr>